package com.s3.khospitalds.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.s3.khospitalds.entity.Trashy;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/3/4
 * @Description: 药品浪费表
 * @Version: 1.0
 */
@Mapper
@Repository
public interface TrashyMapper extends BaseMapper<Trashy> {
    @Select("SELECT * FROM `trashy`")
    public List<Trashy> selectAllTrashy();
    @Update("UPDATE `trashy` SET `name`=#{name}  ,manufacturers= #{manufacturers} ,amount=#{amount}  ,`handlers`= #{handlers} ,`trashy`= #{trashy}  WHERE id=#{id} ")
    public int updateTrashy(Trashy trashy);
    @Insert("INSERT INTO trashy (`name`,amount,handlers,trashy,manufacturers) VALUE(#{name} ,#{amount} ,#{handlers},#{trashy},#{manufacturers} )")
    public int insertTrashy(Trashy trashy);
    @Delete("DELETE FROM `trashy` WHERE id=#{id} ")
    public int deleteTrashy(int id);
    @Delete("DELETE FROM `trashy`")
    public int deleteAllTrashy();
}
